﻿using System;

using NUnit.Framework;
using Spring.Testing.NUnit;

using VisualAgile.Model;
using VisualAgile.IDAL;

namespace VisualAgile.DAL.Tests
{
    [TestFixture]
    public class TaskDaoTest : AbstractTransactionalDbProviderSpringContextTests
    {
        protected override string[] ConfigLocations
        {
            get
            {
                return new String[] { "objects.xml" };
            }
        }

        protected ITaskDao TaskDao
        {
            get
            {
                return applicationContext.GetObject("TaskDao") as ITaskDao;
            }
        }

        [Test]
        public void SaveTaskTest()
        {
            Task task = new Task();

            task.CreateTime = DateTime.Now;
            task.Name = "New Task";
            task.Evaluation = 1.0;
            task.Primary = true;
            task.CreateDate = DateTime.Now;

            TaskDao.Save(task);
            transactionManager.Commit(transactionStatus);
        }       
    }
}
